<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>工作台</title>
    <link rel="stylesheet" href="${ctxPath}/assets/common/libs/layui/css/layui.css?v=${constants.getReleaseVersion()}"/>
    <link rel="stylesheet" href="${ctxPath}/assets/common/module/admin.css?v=${constants.getReleaseVersion()}" media="all"/>
    <link rel="stylesheet" href="${ctxPath}/assets/expand/css/style.css?v=${constants.getReleaseVersion()}" media="all"/>
    <style>
        /** 应用快捷块样式 */
        .console-app-group {
            padding: 16px;
            border-radius: 4px;
            text-align: center;
            background-color: #fff;
            cursor: pointer;
            display: block;
        }

        .console-app-group .console-app-icon {
            width: 32px;
            height: 32px;
            line-height: 32px;
            margin-bottom: 6px;
            display: inline-block;
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            box-sizing: border-box;
            font-size: 32px;
            color: #69c0ff;
        }

        .console-app-group:hover {
            box-shadow: 0 0 15px rgba(0, 0, 0, .08);
        }

        /** //应用快捷块样式 */

        /** top中的会员组 */
        .console-user-group {
            position: relative;
            padding: 15px 0 10px 60px;
        }

        .console-user-group .console-user-group-head {
            width: 40px;
            height: 40px;
            position: absolute;
            top: 50%;
            left: 12px;
            margin-top: -16px;
            border-radius: 50%;
        }

        .console-user-group .layui-badge {
            position: absolute;
            top: 50%;
            right: 8px;
            margin-top: -7px;
        }

        .console-user-group .console-user-group-name {
            line-height: 1.2;
        }

        .console-user-group .console-user-group-desc {
            color: #8c8c8c;
            line-height: 1;
            font-size: 12px;
            margin-top: 5px;
        }


        .dynamic-card-body {
            box-sizing: border-box;
            overflow: hidden;
        }

        .dynamic-card-body:hover {
            overflow-y: auto;
            padding-right: 9px;
        }

        .badge-bronze {
            color:#fff1f0;
            background:#826858;
            border:1px solid #826858
        }

        .badge-silver {
            color:#fff1f0;
            background:#a1a3a6;
            border:1px solid #a1a3a6
        }

        .badge-gold {
            color:#fff1f0;
            background:#c37e00;
            border:1px solid #c37e00
        }

        .badge-platinum {
            color:#464547;
            background:#f6f5ec;
            border:1px solid #f6f5ec
        }

        .badge-diamond {
            color:#3e4145;
            background:#afb4db;
            border:1px solid #afb4db
        }
    </style>

    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
    <script type="text/javascript">
        var Feng = {
            ctxPath: "${ctxPath}",
            version: '${constants.getReleaseVersion()}'
        };
    </script>
</head>
<body>
<!-- 正文开始 -->
<div class="layui-fluid ew-console-wrapper">
    <!-- 总览数据 -->
    <div id="numsAll" class="layui-row layui-col-space15">

        <div class="layui-col-xs12 layui-col-sm6 layui-col-md3">
            <div class="layui-card">
                <div class="layui-card-header">
                    本周会员新增数<span class="layui-badge layui-badge-blue pull-right">周</span>
                </div>
                <div class="layui-card-body">
                    <h5 class="lay-big-font"><span id="memberTiny" class="animate">0</span></h5>
                    <h5>本月会员新增数<span class="pull-right" style="margin-left: 3px">人</span><span id="memberLarge" class="animate pull-right">0</span></h5>
                </div>
            </div>
        </div>

        <div class="layui-col-xs12 layui-col-sm6 layui-col-md3">
            <div class="layui-card">
                <div class="layui-card-header">
                    本周订单支付数<span class="layui-badge layui-badge-blue pull-right">周</span>
                </div>
                <div class="layui-card-body">
                    <h5 class="lay-big-font"><span id="orderTiny" class="animate">0</span></h5>
                    <h5>本月订单支付数<span class="pull-right" style="margin-left: 3px">笔</span><span id="orderLarge" class="animate pull-right">0</span></h5>
                </div>
            </div>
        </div>


        <div class="layui-col-xs12 layui-col-sm6 layui-col-md3">
            <div class="layui-card">
                <div class="layui-card-header">
                    本周商品交易额<span class="layui-badge layui-badge-blue pull-right">周</span>
                </div>
                <div class="layui-card-body">
                    <h5 class="lay-big-font"><span id="tradeTiny" class="animate">0</span></h5>
                    <h5>本月商品交易额<span class="pull-right" style="margin-left: 3px">元</span><span id="tradeLarge" class="animate pull-right">0</span></h5>
                </div>
            </div>
        </div>

        <div class="layui-col-xs12 layui-col-sm6 layui-col-md3">
            <div class="layui-card">
                <div class="layui-card-header">
                    本周佣金支出额<span class="layui-badge layui-badge-blue pull-right">周</span>
                </div>
                <div class="layui-card-body">
                <h5 class="lay-big-font"><span id="profitTiny" class="animate">0</span></h5>
                <h5>本月佣金支出额<span class="pull-right" style="margin-left: 3px">元</span><span id="profitLarge" class="animate pull-right">0</span></h5>
            </div>
            </div>
        </div>

    </div>

    <!-- 快捷方式 -->
    <div class="layui-row layui-col-space15">
        <div class="layui-col-sm6" style="padding-bottom: 0;">
            <div class="layui-row layui-col-space15">
                <div class="layui-col-xs12 layui-col-sm6">
                    <div class="console-app-group" ew-href="/distMember" >
                        <i class="console-app-icon layui-icon layui-icon-group"
                           style="font-size: 26px;padding-top: 3px;margin-right: 6px;"></i>
                        <div class="console-app-name">会员管理</div>
                    </div>
                </div>
                <div class="layui-col-xs12 layui-col-sm6">
                    <div class="console-app-group" ew-href="/distProfitEvent">
                        <i class="console-app-icon layui-icon layui-icon-list"
                           style="color: #b37feb;font-size: 36px;"></i>
                        <div class="console-app-name">分润事件</div>
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-col-sm6" style="padding-bottom: 0;">
            <div class="layui-row layui-col-space15">
                <div class="layui-col-xs12 layui-col-sm6" >
                    <div class="console-app-group" ew-href="/distProfitParam">
                        <i class="console-app-icon layui-icon layui-icon-slider" style="color: #ff9c6e;"></i>
                        <div class="console-app-name">分润参数</div>
                    </div>
                </div>
                <div class="layui-col-xs12 layui-col-sm6">
                    <div class="console-app-group" ew-href="/distWithdrawRecord">
                        <i class="console-app-icon layui-icon layui-icon-rmb" style="color: #ffd666;font-size: 34px;"></i>
                        <div class="console-app-name">分润提现</div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- 分销动态 & 邀请人数top10 -->
    <div class="layui-row layui-col-space15">

        <div class="layui-col-md7 layui-col-sm6">
            <div class="layui-row layui-col-space15">
                <div class="layui-col-md12">
                    <div class="layui-card">
                        <div class="layui-card-header">分润动态</div>
                            <!-- 分销动态占位元素 -->
                        <div id="eventDiv" class="layui-card-body dynamic-card-body mini-bar" style="height: 470px;">
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="layui-col-md5 layui-col-sm6">
            <div class="layui-row layui-col-space15">
                <div class="layui-col-md12">
                    <div class="layui-card">
                    <div class="layui-card-header">邀请排名 TOP10</div>
                    <div class="layui-card-body dynamic-card-body mini-bar" style="height: 470px;">
                        <div id="topViewDiv" style="display: none">
                            <div id="topDiv">
                                <!-- 邀请排名占位元素 -->
                            </div>
                        </div>
                    </div>
                </div>
                </div>
            </div>
        </div>

    </div>
</div>

<!-- js部分 -->
<script type="text/javascript" src="${ctxPath}/assets/common/libs/layui/layui.js?v=${constants.getReleaseVersion()}"></script>
<script type="text/javascript" src="${ctxPath}/assets/common/js/common.js?v=${constants.getReleaseVersion()}"></script>

<script type="text/javascript" src="${ctxPath}/assets/distDashboard/workplace.js"></script>
</body>


<!-- 邀请排名模板 -->
<script id="topTpl" type="text/html">
    {{# layui.each(d, function(i, item) { }}
        <div class="console-user-group">
            {{# var badge = i > 2 ?  'layui-bg-gray' : 'layui-bg-orange';}}
            <span class="layui-badge {{badge}}" style="position: absolute; left:20px; width: 20px; padding-top:1px">{{i + 1}}</span>
            <img src="{{item.memberAvatar}}" class="console-user-group-head" alt="" style="left: 60px"/>
            <div class="console-user-group-name" style="margin-left: 60px">{{item.memberNickname}} <span class="pull-right" style="margin-right: 10px" >邀请加入人数: {{item.inviteNum}} 人</span> </div>
            <div class="console-user-group-desc" style="margin-left: 60px">{{item.memberUsername}} <span class='pull-right layui-badge {{item.badge}}' style="margin-right: 10px;margin-top: 5px" >{{item.memberRankMessage}}段位</span></div>
        </div>
    {{# }); }}
</script>

<!-- 分销动态模板 -->
<script id="eventTpl" type="text/html">
    <div style="padding: 25px 0 0 30px;">
        <ul class="layui-timeline">
            {{# layui.each(d, function(i, item) { }}
            {{# var display = item.display ? item.display : ''}}
            <li class="layui-timeline-item" style="{{display}}" id="{{item.id}}">
                <i class="layui-icon layui-timeline-axis">&#xe63f;</i>
                <div class="layui-timeline-content ">
                    <div class="layui-timeline-title">
                        {{# var css = item.profitType === 'RANK' ? 'layui-bg-orange' : item.profitType === 'INVITE' ? 'layui-bg-green' : 'layui-bg-blue'}}
                        <h3 class="inline-block layui-badge {{css}}" >
                            {{item.profitTypeMessage}}&nbsp;
                            <!-- 后期可以加上用户身份标识 <span class="layui-badge layui-bg-green">组长</span>-->
                        </h3>
                        &emsp;{{item.createTime}}&emsp;
                        <a href="javascript:void(0);" class='dpe-event {{item.id}}'>查看详情</a>
                    </div>
                    <p>触发人：{{item.triggerMemberUsername}}</p>
                    <p>描&emsp;述：{{item.memo}}</p>
                </div>
            </li>
            {{# }); }}
        </ul>
    </div>
</script>

</html>
